import { defHttp } from '/@/utils/http/axios'
import { PageResult, Result } from '/#/axios'
import { BaseEntity } from '/#/web'

/**
 * 分页
 */
export function page(params) {
  return defHttp.get<Result<PageResult<MajorModel>>>({
    url: '/specialityPlan/page',
    params,
  })
}

/**
 * 获取单条
 */
export function get(id) {
  return defHttp.get<Result<MajorModel>>({
    url: '/specialityPlan/findById',
    params: { id },
  })
}

/**
 * 添加/更新
 */
export function saveSpec(obj: MajorModel) {
  return defHttp.post({
    url: '/specialityPlan/saveSpec',
    data: obj,
  })
}

/**
 * 删除
 */
export function del(id) {
  return defHttp.delete({
    url: '/specialityPlan/delete',
    params: { id },
  })
}

/**
 * 专业
 */
export interface MajorModel extends BaseEntity {
  id?: number
  // 专业名称
  specialityName?: string
  // 专业代码
  specialityCode?: string
  // 招生年份
  planTime?: number | string
  // 名额
  num?: number
  // 名额
  passingScore?: number
}
